package com.lucene.blog.db.service.impl;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.lucene.blog.bean.Comment;
import com.lucene.blog.db.mapper.CommentMapper;
import com.lucene.blog.db.service.CommentService;

@Service("commentService")
public class CommentServiceImpl implements CommentService{

	@Resource
	private CommentMapper commentMapper;
	
	public List<Comment> getCommentData(Map<String, Object> map) throws SQLException {
		return commentMapper.getCommentData(map);
	}

	public Long getTotal(Map<String, Object> map) throws SQLException {
		return commentMapper.getTotal(map);
	}

	public Integer addComment(Comment comment) throws SQLException {
		return commentMapper.addComment(comment);
	}

	// 修改评论信息状态
	public Integer updateCommentState(Comment comment) throws SQLException {
		return commentMapper.updateCommentState(comment);
	}

	public Integer deleteCommentById(Integer id) throws SQLException {
		return commentMapper.deleteCommentById(id);
	}

	public Integer deleteCommentByBlogId(Integer blogId) throws SQLException {
		return commentMapper.deleteCommentByBlogId(blogId);
	}

}
